load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test_suite")

package(default_visibility = ["//rs/crypto:__subpackages__"])

DEPENDENCIES = [
    # Keep sorted.
    "//packages/ic-ed25519",
    "//rs/crypto/secrets_containers",
    "//rs/types/types",
    "@crate_index//:rand",
    "@crate_index//:rcgen",
    "@crate_index//:serde",
    "@crate_index//:time",
    "@crate_index//:zeroize",
]

DEV_DEPENDENCIES = [
    # Keep sorted.
    "//rs/crypto/node_key_validation",
    "//rs/crypto/test_utils/reproducible_rng",
    "//rs/protobuf",
    "@crate_index//:assert_matches",
    "@crate_index//:hex",
    "@crate_index//:rand_chacha",
    "@crate_index//:serde_cbor",
    "@crate_index//:x509-parser",
]

rust_library(
    name = "tls",
    srcs = glob(["src/**"]),
    crate_name = "ic_crypto_internal_tls",
    version = "0.9.0",
    deps = DEPENDENCIES,
)

rust_test_suite(
    name = "tls_integration",
    srcs = glob(["tests/**/*.rs"]),
    deps = [":tls"] + DEPENDENCIES + DEV_DEPENDENCIES,
)
